package cn.framelife.rainbow.ui.view;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

/**
 * 异常提示框
 * 
 * @author 潘广伟 p_3er@qq.com  
 * @date 2014-1-6 下午3:43:00
 */
public class ErrorMessageBox {
	public static void showBox(Shell shell,String message){
		MessageBox box = createBox(shell, "Error", message);
		box.open();
	}
	
	/**
	 * 创建一个MessageBox
	 * 
	 * @Title: createBox 
	 * @param @param title
	 * @param @param message
	 * @param @return  
	 * @return MessageBox     
	 * @throws
	 */
	private static MessageBox createBox(Shell shell,String title,String message){
		MessageBox box = new MessageBox(shell, SWT.OK);
		box.setText(title);
		box.setMessage(message);
		return box;
	}
}
